from sqlalchemy import Boolean, Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship

from database import Base


class User(Base):
    __tablename__ = "sys_user"
    id = Column(Integer, primary_key=True, index=True)
    name = Column(String(255), unique=True, index=True)
    password = Column(String(255))


class UserOrder(Base):
    __tablename__ = "m_user_order"
    id = Column(String(50), primary_key=True, index=True)
    user_id = Column(String(255))
    status = Column(Integer)
    create_time = Column(Integer)


class Order(Base):
    __tablename__ = "m_orders"
    id = Column(String(50), primary_key=True, index=True)
    goods_id = Column(String(255))
    order_id = Column(String(255))
    quantity = Column(Integer)

